// package chatroom
//
import java.io.ObjectOutputStream;

public class Visitor implements Comparable<Visitor> {

    public String    name    = null;   // visitor's name
    public boolean   checked = false;  // check to receive private message
    public ObjectOutputStream
		     out     = null;   // output stream to the visitor

    public Visitor() { set( null, false, null); }

    // used on chatroom server side to add visitor to server list.
    public Visitor( ObjectOutputStream out ) { set(null, false, out ); }
  
    // used on chatroom client side to add new visitor to individual client
    // list.
    public Visitor( String name ) { set( name, false, null) ; }
    public Visitor( String name, boolean c ) { set( name, c, null) ; }

    public void set( String n, boolean ck, ObjectOutputStream o )
    { name = n; checked = ck; out = o; }

    public int 	   compareTo( Visitor v )  { return name.compareTo(v.name); }
    public boolean equals( Visitor v )     { return name.equals(v.name) ; }
    public void    changeName( String n )  { name = n; }
}
